package org.myfram.flink.flinkonjar.domain.entity;

import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.util.Bytes;
import org.myfram.flink.flinkonjar.common.connector.hbase.HBaseRowConvert;

import java.io.Serializable;

public class HBaseRowConvertTable extends HBaseRowConvert<HBaseSourceUserTable> implements Serializable {
    private static final long serialVersionUID = 1L;

    @Override
    public HBaseSourceUserTable convertToResult(Result result) throws Exception {
        HBaseSourceUserTable table = new HBaseSourceUserTable();
        table.setId(Bytes.toString(result.getRow()));
        table.setName(Bytes.toString(result.getValue(Bytes.toBytes("info"), Bytes.toBytes("name"))));
        return table;
    }
}
